<?php

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Fitness chat";
if(isset($_POST['username'])){
	$params["nick"] = $_POST['username'];
	if($_POST['username'] == 'mitch'){
		$params["isadmin"] = true;
	}
}else{
	$params["nick"] = "guest".rand(1,1000);  // setup the intitial nickname	
	$params["isadmin"] = false;
}
//$params["isadmin"] = true; // do not use it on production servers ;)

$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
//$params["debug"] = true;
$chat = new phpFreeChat( $params );

?>
<?php include('../views/layouts/_header.php'); ?>
  

 
 <!-- start main content --> 
 <div id="main-content">
 
 	<?php $chat->printChat(); ?>
            

</div>
 <!-- end main content -->
  
 
 <?php include('../views/layouts/_footer.php'); ?>


  
  


